#include<stdio.h>
class Towers
{
public:
    int attack(int myUnits, int hpT, int attackT, int numT)
    {
    	int round=0;
    	int flag = hpT * numT;
    	while(myUnits>0 && flag > 0)
    	{
    		round++;
    		flag -= myUnits;
    		if(flag%hpT == 0) 
    			myUnits -=(flag/hpT) * attackT;
    		else
    			myUnits -=((int)(flag/hpT) + 1) * attackT;
    	}
    	//Initially, flag must be above 0; 
    	//or 1000000,3,10000,10000 will not pass judge;
    	if(myUnits<1 && flag>0) 
    		return -1;
    	else if(flag < 1)
    		return round;
    	else return 0;
    }
};
